package com.zgcs.sequence.net.in;

import com.zscg.sequence.data.User;
import com.zscg.sequence.model.UserManager;

public class LoginPackage extends InPackage {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1841859425631574653L;

	String msg;
	User user;

	public LoginPackage(String result) {
		super(result);
	}

	@Override
	public void parserSelf() {
		if (Integer.parseInt(resultSpl[2]) == 1) {
			user = new User();
			user.setUserId(Integer.parseInt(resultSpl[3]));
			user.setUserName(resultSpl[4]);
			UserManager.getInstance().updateUser(user);
		}
		msg = resultSpl[5];
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
